<template>
  <div>
    <j-select-biz-component-asset-all
      :value="value"
      :multiple="flag"
      name="资产名称"
      :disabled="false"
      displayKey="name"
      :listUrl="url.list"
      :columns="columns"
      v-on="$listeners"
      :assetTypeF="assetTypeF"
      v-bind="$attrs"
    />
  </div>
</template>
<script>
import JSelectBizComponentAssetAll from './JSelectBizComponentAssetAll'

export default {
  name: 'JSelectAssetsNew',
  components: { JSelectBizComponentAssetAll },
  props: ['value','assetTypeF'],
  data() {
    return {
      default: {
        name: '资产',
        width: 2200,
        returnId: true,
        displayKey: 'name',
        queryParamCode: 'name',
        returnKeys: ['id', 'name'],
        queryParamText: '资产名称',
        // queryParamObj: {'status': "1"},
      },
      flag:true,

      url: { list: '/zcgl/assetFixed/allList' },
      columns: [
        { title: '资产名称', dataIndex: 'name', align: 'center', width: 300 },
        { title: '规格', dataIndex: 'specifications', align: 'center', width: 180 },
        { title: '数量', dataIndex: 'amount', align: 'center', width: 50 }
      ]
    }
  },

  created () {
    // if(assetTypeF == 'BGYP01'){
    //   this.url.list = '/zcgl/assetFixed/list?assetType=BGYP01'
    // }
    // if(assetTypeF == 'YHP01'){
    //   this.url.list = '/zcgl/assetFixed/list?assetType=YHP01'
    // }
    // if(assetTypeF == 'CHWZ01'){
    //   this.url.list = '/zcgl/assetFixed/list?assetType=CHWZ01'
    // }
  },

  computed: {
    attrs() {
      return Object.assign(this.default, this.$attrs)
    }
  },
  methods:{

    // select: function (childValue) {
    //     // childValue就是子组件传过来的值
    //
    //     this.dataVlue = childValue[0]
    //
    //   }

  }
}
</script>
